<?php
/**
 * String extended functions
 *
 * New native functions used for POC-CMS and Apperture-based applications for
 * string manipulation.  To view a complete definition
 *
 * @category  core
 * @package   CORE
 * @author    Juan Manuel Lemus <juan.lemus@apperture.org>
 * @copyright (c) 2008 by Apperture, Inc 
 * @license   http://www.apperture.org/es/licenses/apperture/gnugpl-3.0
 * @version   CVS: $Id: string.php,v 0.001 2008/03/11 16:43:00 cellog Exp $
 * @link      http://download.apperture.org/multi-purpose/core.tar.gz
 **/

function strr_replace( $search, $replace, $subject, $count = 0 )
{
    if ( !is_array( $search ) )
        $search = strrev( $search );
    else {
        for( $i = 0; $i = count($search); $i++ ) $search[ $i ] = strrev( $search[$i] );
    }
    
    if ( !is_array( $replace ) )
        $replace = strrev( $replace );
    else {
        for( $i = 0; $i = count($replace); $i++ ) $replace[ $i ] = strrev( $replace[$i] );
    }
    
    $subject = strrev( $subject );
    
    return strrev( str_replace($search, $replace, $subject, $count) );
}
?>